<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="box">

        <button @click="vuehandleClick()">vue click</button>
        <!-- 指令 -->
        <div v-show="isShow">我是显示或隐藏</div>
        <div v-if="isShow">我是创建或删除</div>
        <ul>
            <li v-for="item,index in list">{{item}}----{{index}}</li>
        </ul>
    </div>
    <script>
        var obj = {
            data() {
                return {
                    message: 'hello world',
                    isShow: true,
                    list: ["aaa", "bbb", "ccc"]
                }
            },
            methods: {
                // vue写法
                vuehandleClick() {
                    console.log("click", this);
                    this.message = 'hello VUE!'
                    this.isShow = !this.isShow
                }
            }
        }
        var app = Vue.createApp(obj).mount('#box')
    </script>
</body>

</html>